CP SC 1011: Lab 5, Fall 2022

Using an editor, answer the following questions:

NAME: Campbell Kemp

---------
example.c
---------
1) What is the cause of the seg fault in the program called example.c?
	The i in the for loop is initialized to 0 and the loop only starts i is greater than or equal to 0.  
	The loop increment is +1.  
	Therefore, the for loop in example.c is an infinite loop, which causes a seg fault.
--------
broken.c
--------
2) What line in broken.c did the program seg fault on?
28

3) What was the value of the variable "count" at the time of the seg fault?
10

4) What was the value of the variable "i" at the time of the seg fault?
417

5) What was the value of the variable "search" at the time of the seg fault?
1

6) What are the values in the "table" array?
table[0] = 5
table[1] = 10
table[2] = 12
table[3] = 14
table[4] = 16
table[5] = 18
table[6] = 20
table[7] = 22
table[8] = 24
table[9] = 26

7) what do you think the bug is?
I think there is an issue with the conditional within the while statement.

